

import React from 'react'
import merge from 'lodash/merge'

// import { Modal, message } from 'antd'
import { Modal, Message } from '@arco-design/web-react'



export const MessageContextHolder = () => {
    React.$message = Message
    return <></>
}

export const ModalContextHolder = () => {
    React.$modal = Modal
  
    React.$confirm = (config = {}) => {
      return Modal.confirm(
        merge(
          {
            title: '提示',
            width: 500,
            // icon: React.$icon('icon-ic_prompt_1', 'anticon'),
            // autoFocusButton: null,
            // centered: true
            // cancelText:'取消',
            // closable:true,
          },
          config
        )
      )
    }
    return <></>
  }
  